home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / rundoc.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  4.5 KB  |  114 lines

  1. #! /bin/csh
  2. #  rundoc is a csh script to run a Fortran program instrumented by ISTAN
  3. #  and generate documentation information therefrom using ISTAL.
  4. #
  5. #
  6. #  Invocation:
  7. #
  8. #  rundoc execute_command_line input_file output_file
  9. #
  10. #  Note: execute_command_line is a command line in Unix for the execution
  11. #  of a program instrumented with script inst.  The command line must be
  12. #  written without blanks.
  13. #
  14. #  Check command line validity.
  15. if ( $#argv < 3 ) then
  16. TOOLPACKPATH/toolpack1.2/util/echoerr \
  17. Invocation:
  18. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  19. TOOLPACKPATH/toolpack1.2/util/echoerr \
  20. rundoc execute_command_line input_file output_file
  21. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  22. TOOLPACKPATH/toolpack1.2/util/echoerr \
  23. execute_command_line is a Unix command line, written without blanks, for
  24. TOOLPACKPATH/toolpack1.2/util/echoerr \
  25. the execution of a program instrumented with script '"inst"'.
  26. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  27. TOOLPACKPATH/toolpack1.2/util/echoerr \
  28. input_file is a user-written template of a report that will be written
  29. TOOLPACKPATH/toolpack1.2/util/echoerr \
  30. as output_file.  input_file has the form of a document containing troff
  31. TOOLPACKPATH/toolpack1.2/util/echoerr \
  32. requests.  In the places in the document where information derived from
  33. TOOLPACKPATH/toolpack1.2/util/echoerr \
  34. instrumenting and executing the program is to be inserted, the user
  35. TOOLPACKPATH/toolpack1.2/util/echoerr \
  36. writes a special request of the form '".al X"' where '"X"' indicates
  37. TOOLPACKPATH/toolpack1.2/util/echoerr \
  38. the information to be inserted.  Following are the acceptable values
  39. TOOLPACKPATH/toolpack1.2/util/echoerr \
  40. for X showing the nature of the information that will be inserted:
  41. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  42. TOOLPACKPATH/toolpack1.2/util/echoerr \
  43. '_SE    A summary, by program unit, of segment execution counts'
  44. TOOLPACKPATH/toolpack1.2/util/echoerr \
  45. '_TO    A summary, by program unit, of segment execution counts as'
  46. TOOLPACKPATH/toolpack1.2/util/echoerr \
  47. '       fractions of the total'
  48. TOOLPACKPATH/toolpack1.2/util/echoerr \
  49. '_Z     A summary, by program unit, of segments not executed'
  50. TOOLPACKPATH/toolpack1.2/util/echoerr \
  51. '_L     A listing of the program showing segment execution counts'
  52. TOOLPACKPATH/toolpack1.2/util/echoerr \
  53. '_AS    A summary, by program unit, of assertion failures'
  54. TOOLPACKPATH/toolpack1.2/util/echoerr \
  55. '_DY    A summary, by program unit, of statement type execution counts'
  56. TOOLPACKPATH/toolpack1.2/util/echoerr \
  57. "_IC    Blocks of comments included by the SED "switch" (see Users' Guide)"
  58. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  59. TOOLPACKPATH/toolpack1.2/util/echoerr \
  60. A summary report of segment execution counts and assertion failure
  61. TOOLPACKPATH/toolpack1.2/util/echoerr \
  62. counts will be placed in a file called '"_.XREPORT"' in the working
  63. TOOLPACKPATH/toolpack1.2/util/echoerr \
  64. directory, regardless of what information is specified in input_file.
  65. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  66. TOOLPACKPATH/toolpack1.2/util/echoerr \
  67. Files '"_.ANSTATICSUM"' and '"_.ANANNOLIST"' from the execution of inst
  68. TOOLPACKPATH/toolpack1.2/util/echoerr \
  69. must be present in the working directory and are retained.
  70. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  71.    exit
  72. endif
  73. #  The output file is written to stdout.  The existence of files
  74. #  _.ANSTATICSUM and _.ANANNOLIST from an execution of script inst
  75. #  is assumed.  Check to be sure these files exist.
  76. if ( -e _.ANSTATICSUM == 0 || -e _.ANANNOLIST == 0 ) then
  77. TOOLPACKPATH/toolpack1.2/util/echoerr \
  78. _.ANSTATICSUM and _.ANANNOLIST from execution of script inst
  79. TOOLPACKPATH/toolpack1.2/util/echoerr \
  80. must be present in the working directory.
  81.    exit
  82. endif
  83. #
  84. #  Create PFS.  If PFS already exists, exit with an advisory message.
  85. #
  86. if ( -e _.TOOLPACK == 0 ) then
  87.    mkdir _.TOOLPACK
  88. else
  89. TOOLPACKPATH/toolpack1.2/util/echoerr \
  90. Toolpack-created directory '"_.TOOLPACK"' exists. \
  91. Remove with script '"discard"'.
  92.    exit
  93. endif
  94. #  Run the instrumented program.
  95. $1
  96. #  Create the input file for ISTAL by prepending the macro definitions
  97. #  and file loading commands to input_file, and then expanding the macros.
  98. set repin = alin$$
  99. set scratch = scrch$$
  100. cat TOOLPACKPATH/toolpack1.2/util/Rundoc.Head $2 > _.TOOLPACK/$scratch
  101. m4 _.TOOLPACK/$scratch > _.TOOLPACK/$repin
  102. #  Create the interprocess file IST.CMD and append parameters for ISTAL.
  103. TOOLPACKPATH/toolpack1.2/util/mkipf \
  104. $repin \#$3
  105. #
  106. #  Invoke ISTAL.
  107. #
  108. TOOLPACKPATH/toolpack1.2/exec/istal.u
  109. #
  110. #  Move instrumented-run generated file to the PFS where it will be removed.
  111. mv _.ANRUNDATA _.TOOLPACK
  112. /bin/rm -r _.TOOLPACK
  113. #
  114.